package doantotnghiep.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import doantotnghiep.dao.CategoryDao;
import doantotnghiep.model.Category;

public class CategoryBusiness {

	@Autowired
	private CategoryDao categoryDao;
	
	public List<Category> listCategory() {
		return categoryDao.getListCategory();
	}

	public void addCategory(Category category) {
		categoryDao.addCategory(category);
	}

	public Category getCategoryrById(int id) {
		return categoryDao.getCategoryByID(id);
	}

	public void saveCategoryChanged(Category category) {
		categoryDao.saveCategory(category);
		
	}

	public void deleteCategory(int id) {
		categoryDao.deleteCategory(id);
	}

	public void inceaseNumberOfMedicine(int i) {
		categoryDao.inceaseNumberOfMedicine(i);
	}

}
